package com.ubi.core.framework.response;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;

import java.util.Locale;

public class CheckIsExistsResponseBuilder {

    @Autowired
    MessageSource messages;

    public CheckIsExistsResponse ok() {
        CheckIsExistsResponse checkIsExistsResponse = new CheckIsExistsResponse();
        checkIsExistsResponse.put("ok", messages.getMessage("default.record.not.exists", null, Locale.getDefault()));
        return checkIsExistsResponse;
    }

    public CheckIsExistsResponse error() {
        CheckIsExistsResponse checkIsExistsResponse = new CheckIsExistsResponse();
        checkIsExistsResponse.put("error", messages.getMessage("default.record.exists", null, Locale.getDefault()));
        return checkIsExistsResponse;
    }
}
